<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>邮箱地址管理</title>
	</head>
	<body>
		<table cellpadding='0' cellspacing='0' style='font-size:11px; font-family: "Microsoft Yahei"'>
		<form action="/email-host" method="GET" target="_self">
		<input type="hidden" name="batch" value="{$batch}"></input>
		<?php echo $label?"<input type=\"hidden\" name=\"label\" value=\"{$label}\"></input>":'' ?>
		<tr>
			<td colspan="4" style="line-height: 30px;">
				前 <input type="text" name="limit" value="{$limit}" size="4" style='text-align: center; font-size:11px; font-family: "Microsoft Yahei"'></input> 名
				<br />
				<textarea rows="5" cols="60" name="always" style='overflow-y: hidden; font-size:11px; font-family: "Microsoft Yahei"'><?php echo implode(',', $always); ?></textarea>
				<br />
				<input type="submit" value=" 查询 " style='font-size: 11px; font-family: "Microsoft Yahei"'></input>
			</td>
		</tr>
		</form>
		<tr>
			<td colspan="4" height="30">&nbsp;</td>
		</tr>
		<tr>
			<th height="20" align="left" style="width: 40px; border-bottom: 1px solid #CCC;">名次</td>
			<th align="left" style="border-bottom: 1px solid #CCC;">主机名</td>
			<th align="left" style="width: 60px; border-bottom: 1px solid #CCC;">数量</td>
			<th align="left" style="width: 25px; border-bottom: 1px solid #CCC;">操作</td>
		</tr>
		<?php
		$list = array();
		$count = 0;

		foreach($hosts as $host => $num):

		$list[] = $host;
		?>
		<tr>
			<td height="25" style="padding-right:10px; border-bottom:1px solid #CCC;"><?php echo count($list); ?></td>
			<td style="border-bottom:1px solid #CCC;">{$host}</td>
			<td style="border-bottom:1px solid #CCC;">{$num}</td>
			<td style="border-bottom:1px solid #CCC;"><a href="/email-delete?host={$host}" target="_blank">删除</a></td>
		</tr>
		<?php
		$count += $num;

		endforeach;
		?>
		<tr>
			<td colspan="2" height="25" style="padding-right:10px; border-bottom:1px solid #CCC;">&nbsp;</td>
			<td colspan="2" style="border-bottom:1px solid #CCC;">{$count}</td>
		</tr>
		<?php
		if($label):
		?>
		<form action="/queue-make" method="POST" target="_self">
		<input type="hidden" name="batch" value="{$batch}"></input>
		<input type="hidden" name="label" value="{$label}"></input>
		<input type="hidden" name="hosts" value="<?php echo implode(',', $list); ?>"></input>
		<tr>
			<td colspan="4" height="40" align="center" valign="bottom"><input type="submit" value="创建队列" style='font-size: 11px; font-family: "Microsoft Yahei";'></input></td>
		</tr>
		</form>
		<?php
		endif;
		?>
		</table>
	</body>
</html>